<template>
  <div class="header">
    <div>
      <breadcrumb :breadcrumb="breadcrumb" />
    </div>
    <div>用户</div>
  </div>
</template>

<script>
import Breadcrumb from "./breadcrumb.vue";
import { useRoute } from "vue-router";
import { menuToBreadcrumb } from "@/utils/map-menu";
import localCache from "@/utils/cache";
import { computed } from "vue";
export default {
  components: { Breadcrumb },
  setup() {
    const breadcrumb = computed(() => {
      const route = useRoute();
      const currentPath = route.path;
      const menus = localCache.getItem("menuInfo");
      return menuToBreadcrumb(menus, currentPath);
    });
    return {
      breadcrumb,
    };
  },
};
</script>

<style lang="less" scoped>
.header {
  height: 100%;
  //background-color: pink;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #e6e6e6;
}
</style>
